from xml.dom.minidom import parse;

xmlAct = parse("./Act.xml");
actCollection = xmlAct.documentElement;
actElements = actCollection.getElementsByTagName("activity");

for actItem in actElements:
    print "*Activity:";
    print "id:", actItem.getAttribute("id");
    print "name:", actItem.getAttribute("name");
    print "subject:", str(actItem.getAttribute("subject").replace("[","").replace("]","")).split(",");
    print "object:", str(actItem.getAttribute("object").replace("[","").replace("]","")).split(",");
    print "time:", str(actItem.getAttribute("time").replace("[","").replace("]","")).split(",");
    print "parents:", actItem.getAttribute("parents");
    print "score:", actItem.getAttribute("score");
    print "location:", actItem.getAttribute("location");
    subActElements = actItem.getElementsByTagName("sub-activity");
    for subActItem in subActElements:
        print "    *SubActivity:";
        print "    id:", actItem.getAttribute("id");
        print "    name:", actItem.getAttribute("name");
        print "    subject:", str(actItem.getAttribute("subject").replace("[","").replace("]","")).split(",");
        print "    object:", str(actItem.getAttribute("object").replace("[","").replace("]","")).split(",");
        print "    time:", str(actItem.getAttribute("time").replace("[","").replace("]","")).split(",");
        print "    parents:", actItem.getAttribute("parents");
        print "    score:", actItem.getAttribute("score");
        print "    location:", actItem.getAttribute("location");
        